/* Used to make sure files are only brought in once */
#ifndef BALLS_H
#define BALLS_H

#include "IDrawable.h"
#include "Common.h"

#include <vector>

struct State
{
   bool moving;
   bool onTable;
   int index;
};

class Ball : public IDrawableObject 
{
public:
   Ball();
   void draw(bool);
   void drawShadow(Vec3f pos, Vec3f dif, int index);
   Vec3f getPosition();
   Vec3f getInitialPosition();
   Vec3f getOrigin();
   void setOrigin(Vec3f);
   double getDiameter();
   double getRadius();
   void setForce(Force);
   Force getForce();
   bool isStopped();
   void inPocket();
   static vector<Ball*> getBalls();
   State state;
protected:
   Vec3f origin;
   Vec3f initialPosition;
   double radius;
   Force force;
   long startTime;
   long getTime();
   static vector<Ball*> balls;
   virtual int getTexture();
   double getCurrentHAngle();
   double getCurrentVAngle();
   double hAngle;
   double vAngle;
   double latestHAngle;
   double latestVAngle;
   double pocketed;
   double stopped;
   void setupCueBall();
};

class CueBall : public Ball
{
public:
   CueBall();
   int getTexture();
};

#endif
